package cn.yogehaoren.custom;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;

import java.io.IOException;

/**
 * @author WangNing
 * @since 1.0
 */
public class MyCustomConsumer extends DefaultConsumer {



    public MyCustomConsumer(Channel channel){
        super(channel);

    }

    @Override
    public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
        System.out.println("------------- consumer message ---------------");
        System.out.println("consumerTag" + consumerTag);
        System.out.println("envelope" + envelope);
        System.out.println("properties" + properties);
        System.out.println("body" + new String(body));

    }

}
